package org.NooLab.somclients.domains;

import org.NooLab.somclients.intf.SomClientsPublicIntf;
import org.NooLab.somfluid.properties.SomDynamicsIntf;
import org.NooLab.utilities.net.GUID;





public class ScSomfixParamPkg implements ScSomfixParamPkgIntf{

	int packageType = SomClientIntf._SOMCLIENT_TYPE_SOMDED;
	String guid = "";
	
	private int somType = -1;;
	private int fieldTopology = -1;
	private int initialSize = 0;
	private int portOfRemoteServer;
	private int templateSomConfigurationSID;
	private SomClientsPublicIntf somClients=null;
	private boolean useDirectReference;

	private int gridType = -1;
	private long somId = 0L;
	private int somLevel = 1 ;
	private int sourceMode = -1;

	private String sourceDbName = "";
	private String targetDbName = "";
	private String projectName  = "";
	private String transferSourceDatabaseName = "";
	private String transferTargetDatabaseName = "";
	private int abstractionSupport=0 ;
	private int growthIntensity;
	private int[] growthmodes;
	 
	
	
	// ========================================================================
	public ScSomfixParamPkg(){
		guid = GUID.randomvalue();
	}
	// ========================================================================	
	
	@Override
	public int getPackageType() {
		
		return packageType;
	}

	public void setPackageType(int packageType) {
		this.packageType = packageType;
	}
	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	@Override
	public void setInitialSize(int inisize) {
		initialSize = inisize ;
		
	}

	@Override
	public void setTopology(int fieldTopology) {
		this.fieldTopology = fieldTopology ;
		
	}

	@Override
	public void setSomType(int somtype) {
		
		somType = somtype ;
	}

	public int getSomType() {
		return somType;
	}

	@Override
	public void hostAddressPort(int portOfRemoteServer) {
		// 
		this.portOfRemoteServer = portOfRemoteServer;
	}
	@Override
	public void useTemplateConfig(int sid) {
		// 
		templateSomConfigurationSID = sid;
	}
	@Override
	public void setHost(SomClientsPublicIntf somClientsHost, boolean useDirectReference) {
		// 
		somClients = somClientsHost;
		this.useDirectReference = useDirectReference;
	}
	@Override
	public SomClientsPublicIntf getHost() {
		//  
		return somClients;
	}

	@Override
	public boolean useDirectReference() {
		//  
		return useDirectReference;
	}
	@Override
	public void setGridType(int gridtype) {
		gridType = gridtype;
	}
	@Override
	public int getGridType() {
		return gridType;
	}
	@Override
	public void setSomId(long somid) {
		somId = somid ;
		
	}

	public long getSomId() {
		return somId;
	}

	@Override
	public void setTargetDbName(String dbName) {
		targetDbName = dbName;
	}

	@Override
	public String getTargetDbName() {
		 
		return targetDbName;
	}

	@Override
	public void setSourceDbName(String dbName) {
		// 
		sourceDbName = dbName;
	}
	@Override
	public String getSourceDbName() {
		return sourceDbName;
	}
	public int getFieldTopology() {
		return fieldTopology;
	}

	public void setFieldTopology(int fieldTopology) {
		this.fieldTopology = fieldTopology;
	}

	public int getInitialSize() {
		return initialSize;
	}

	public int getPortOfRemoteServer() {
		return portOfRemoteServer;
	}

	public void setPortOfRemoteServer(int portOfRemoteServer) {
		this.portOfRemoteServer = portOfRemoteServer;
	}

	public int getTemplateSomConfigurationSID() {
		return templateSomConfigurationSID;
	}

	public void setTemplateSomConfigurationSID(int templateSomConfigurationSID) {
		this.templateSomConfigurationSID = templateSomConfigurationSID;
	}

	public SomClientsPublicIntf getSomClients() {
		return somClients;
	}

	public void setSomClients(SomClientsPublicIntf somClients) {
		this.somClients = somClients;
	}

	
	public boolean isUseDirectReference() {
		return useDirectReference;
	}
	public void setUseDirectReference(boolean useDirectReference) {
		this.useDirectReference = useDirectReference;
	}

	@Override
	public void setProjectName(String prjname) {
		projectName = prjname;
	}
	@Override
	public String getProjectName() {
		return projectName ;
		
	}

	 
	@Override
	public void setSomLevel(int somlevel) {
		somLevel = somlevel;
	}

	@Override
	public int getSomLevel() {
		 
		return somLevel;
	}

	@Override
	public void setSourceMode(int sourcemode) {
		sourceMode = sourcemode;
	}

	@Override
	public int getSourceMode() {
		return sourceMode;
	}

	@Override
	public void setTransferSourceDbName(String dbname) {
		transferSourceDatabaseName = dbname	;	
	}

	@Override
	public String getTransferSourceDbName() {
		 
		return transferSourceDatabaseName;
	}

	@Override
	public void setTransferTargetDbName(String dbname) {
		transferTargetDatabaseName = dbname ;
	}

	@Override
	public String getTransferTargetDbName() {
		return transferTargetDatabaseName;
	}

	@Override
	public void setAbstractionSupport(int flag) {
		abstractionSupport = flag;
	}
	
	@Override
	public int getAbstractionSupport() {
		return abstractionSupport ;
	}

	@Override
	public int[] getGrowthMode() {
		if ((growthmodes==null) || (growthmodes.length==0)){
			growthmodes = new int[]{SomDynamicsIntf._SOM_GROWTH_NONE} ;
		}
		return growthmodes;
	}

	@Override
	public void setGrowthMode(int[] gmodes) {
		growthmodes = gmodes ;
	}

	@Override
	public int getGrowthIntensity() {
		return growthIntensity;
	}

	@Override
	public void setGrowthIntensity(int intensity) {
		growthIntensity = intensity;
	}

	
}
